<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import="com.tmpt.utils.Config"%>
<%@include file="../base.jsp" %>   
<s:if test="#attr.productId!=null">
	<s:set var="productId" value="#attr.productId"></s:set>
</s:if>
<s:if test="#attr.productId==null">
	<s:set var="productId" value="#parameters.productId[0]"></s:set>
</s:if>

<s:if test="#attr.productPicId!=null">
	<s:set var="productPicId" value="#attr.productPicId"></s:set>
</s:if>
<s:if test="#attr.productPicId==null">
	<s:set var="productPicId" value="#parameters.productPicId[0]"></s:set>
</s:if>

<sys:genericTag4o 
	methodName="queryProductPictureById" 
	className="com.wxy.controller.taglib.PictureTag" 
	id="productPictureMap">
	<sys:columnTag columnName="productPicId" columnValue="${param.productPicId}"/>
</sys:genericTag4o>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>	
<script type="text/javascript" src="../../js/jquery-1.8.0.min.js"></script>
<link href="../css/main.css" rel="stylesheet" type="text/css" >

<script src="${path}/js/jquery/easyui/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="../../js/jquery.select.js"></script>
<script type="text/javascript" src="js/productAdd.js"></script>
<script type="text/javascript" src="${path}/js/calendar.js"></script>
<script src="${path}/js/jquery/easyui/jquery.easyui.min.js"></script>
</head>
<body class="font14">

<table width="100%">
	<tr>
		<td valign="top"  width="200px">
			<%@include file="productAddStep1.jsp" %>
			<script type="text/javascript">
			$(function(){
				$("#productAddStep_4>a").css("color","red");
			});
			$("#productAddStep_4>a").css("color","red");
			</script>			
		</td>
		<td valign="top"  width="600px">
			<s:if test="#attr.result!=null">
				<table class="table1" width="100%" cellpadding="0" cellspacing="0" >	
					<thead>
						<tr style="background-color: #DEE9FB; color: #15428B;">
							<td align="center">
								<strong>操作结果</strong>
							</td>
						</tr>
					</thead> 
					<tr>
						<td><font color="red"><s:property value="#attr.result"/></font>	</td>
					</tr>
				</table>
				<br/> 
			</s:if> 	
			<s:form id="formProductPic" action="product!addPicture.action" namespace="/admin123/product" theme="simple">		
			<table class="table1" align="center" width="100%" cellpadding="0" cellspacing="0">
				<thead>
					<tr style="background-color: #DEE9FB; color: #15428B;">
						<td colspan="2" align="center">
							<strong>商品图片管理</strong>
							<input type="hidden" name="productId" value="${attr.productId}">
							<input type="hidden" name="productPicId" value="${attr.productPicId}">
						</td>
					</tr>
				</thead>
				<tbody>
					<tr>	
						<td>图片编号:</td>
						<td>
							<input type="text" name="pictureManagerId" value="${attr.productPictureMap.pictureManagerId}" maxlength="10"
							 class="easyui-numberbox"
                                        min="1" 
                                        max="99999999999999999999" 
                                        precision="0" 
							>
						</td>
					</tr> 
					<tr>	
						<td>是否默认图片:</td>
						<td>
							<s:select 
							   list="#{1:'是',0:'否'}"
							   name="isDefaultPic"
							   theme="simple"
							   value="#attr.productPictureMap.isDefault"/>
							&nbsp;&nbsp;描述:商品展示时，作为商品默认图片显示
						</td>
					</tr> 
				</tbody>
				<tfoot style="border-top: 1px solid #DEE9FB;">
					<tr>
						<td colspan="2" align="center" style="border-top: 1px solid #DEE9FB;">
							<input type="submit" value="添加">
							&nbsp;&nbsp;
							<input type="button" value="编辑" onclick="javascript:editProductPic();">
							<script type="text/javascript">
							function editProductPic(){
								$('#formProductPic').attr('action','product!editProductPic.action');
								$('#formProductPic').submit();
							}
							</script>
						</td>
							
						
					</tr>
				</tfoot>
			</table>
			</s:form>
			<s:if test="#attr.productPictureMap.thumbForList!=null">
				<img alt="" src="${attr.path}/pictures/${attr.productPictureMap.thumbForList}">
			</s:if>
		</td>
		<td valign="top">
			<jsp:include page="productInfo.jsp">
				<jsp:param name="productId" value="${attr.productId}"/>
			</jsp:include>
		</td>
	</tr>
</table>


</body>
</html>